/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Presenter;

import View.loginView;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 *
 * @author Bush
 */
public class LoginPresenter {
    private loginView view;

    public LoginPresenter() {
        view = new loginView();
        
        view.getBtnLogin().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {                
                login();
                
            }
        });
        view.getBtnSair().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                sair();
            }
        });
        view.setLocationRelativeTo(view);
        view.setVisible(true);
    }    
    
    public void login(){
        view.dispose();
        new TelaPrincipalPresenter(view.getTxtApelido().getText());
    }
    public void sair(){}
    
}
